<template>
	<view class="">
		<view class="p30 bg-fff">
			<view class="flex-col row-center col-center">
				<view class="">
					<image :src="data.avatar_path" class="w120 h120 radius10" mode="aspectFill"></image>
				</view>
				<view class="fw-w mt10 fs32">{{data.name}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">团队人数：</view>
				<view class="">{{data.master_num}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">服务总数：</view>
				<view class="">{{data.service_num}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">创建人：</view>
				<view class="">{{data.creator_name}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">创建时间：</view>
				<view class="">{{data.create_time}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">团队电话：</view>
				<view class="">{{data.mobile}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">团队地区：</view>
				<view class="">{{data.city_name}}</view>
			</view>
			<view class="flex row-between pt30">
				<view class="color-999">详细地址：</view>
				<view class="">{{data.address}}</view>
			</view>
		</view>
		<view class="mt20 p30 bg-fff">
			<view class="color-999">
				<text>{{data.introduce}}</text>
			</view>
			<view class="h20"></view>
			<z-imgs :paths="data.images_path" look margin="20" radius="10" />
		</view>
		<view class="tc p20 color-666" v-if="data.identity=='creator'" @click="dissolve">解散团队</view>
		<view class="h120"></view>
		<view class="pf w-max left0 bottom0 bg-fff">
			<view class="flex1 p20" v-if="data.identity=='creator'">
				<u-button type="warning" ripple @click="$jump('/pages/my/team/creation',$params)">编辑信息</u-button>
			</view>
			<view class="flex1 p20" v-else-if="!data.identity">
				<u-button type="warning" ripple @click="$tool.phone(data.mobile)">联系团队</u-button>
			</view>
			<view class="flex1 p20" v-else>
				<u-button type="warning" ripple @click="quit">退出团队</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: ''
			};
		},
		onLoad() {

		},
		onShow() {
			this.getData()
		},
		methods: {
			getData() {
				this.$request('/master/agency/agencyInfo', this.$params).then(res => {
					this.data = res.data
				})
			},
			async quit() {
				await this.$showModal('提示', '确认要退出吗？')
				this.$request('/master/agency/outAgency', this.$params).then(res => {
					this.$msg(res.msg)
					this.$navBack(2,1000)
				})
			},
			async dissolve() {
				await this.$showModal('提示', '确认要解散团队吗？')
				this.$request('/master/agency/dissolutionAgency', this.$params).then(res => {
					this.$msg(res.msg)
					this.$navBack(2,1000)
				})
			}
		}
	}
</script>

<style lang="scss">

</style>